package com.gaojinqi.sys.modular.config.model;

import com.gaojinqi.base.common.model.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

import static com.gaojinqi.sys.modular.config.model.SysConfig.TABLE_NAME;

/**
 * @author gaojinqi
 * @version 1.0
 * @since 2020年04月15日
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = TABLE_NAME)
@org.hibernate.annotations.Table(appliesTo = TABLE_NAME, comment = "系统配置表")
public class SysConfig extends BaseEntity {

    private static final long serialVersionUID = -1578616577483716601L;

    public static final String TABLE_NAME = "sys_config";

    @Id
    @GeneratedValue(generator = TABLE_NAME + "_uuid")
    @GenericGenerator(name = TABLE_NAME + "_uuid", strategy = "uuid")
    @Column(columnDefinition = "varchar(32)  COMMENT '配置ID'")
    private String configId;

    @Column(columnDefinition = "varchar(32)  COMMENT '配置唯一标识'", unique = true)
    private String configCode;

    @Column(columnDefinition = "varchar(64)  COMMENT '配置名'")
    private String configName;

    @Column(columnDefinition = "varchar(64)  COMMENT '配置值'")
    private String configValue;

    @Column(columnDefinition = "varchar(255)  COMMENT '备注'")
    private String remark;

    // 0关闭，1启用
    @Column(columnDefinition = "int(1)  COMMENT '状态'")
    private Byte state;

}
